<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\UserPart
 *
 * @property int $id
 * @property string $title 标题
 * @property int $posture_id 体态表id
 * @property int $order 排序
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property \Illuminate\Support\Carbon|null $deleted_at
 * @property-read UserPart|null $posture
 * @method static \Illuminate\Database\Eloquent\Builder|UserPart newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|UserPart newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|UserPart onlyTrashed()
 * @method static \Illuminate\Database\Eloquent\Builder|UserPart query()
 * @method static \Illuminate\Database\Eloquent\Builder|UserPart whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserPart whereDeletedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserPart whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserPart whereOrder($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserPart wherePostureId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserPart whereTitle($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserPart whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserPart withTrashed()
 * @method static \Illuminate\Database\Eloquent\Builder|UserPart withoutTrashed()
 * @mixin \Eloquent
 */
class UserPart extends Model
{
	use HasDateTimeFormatter;
    use SoftDeletes;

    protected $table = 'user_part';

    public function posture(): BelongsTo
    {
        return $this->belongsTo(UserPart::class, 'posture_id');
    }

}
